import request from '@/config/axios'

// 教师学习情况 VO
export interface TeacherStudyVO {
  // 编号
  id: number
  // 教师工号
  teacherNumber: string
  // 教师姓名
  teacherName: string
  // 部门id
  deptId: number
}

// 教师学习情况 API
export const TeacherStudyApi = {
  // 查询教师学习情况分页
  getTeacherStudyPage: async (params: any) => {
    return await request.get({ url: `/data/teacher-study/page`, params })
  },

  // 查询教师学习情况详情
  getTeacherStudy: async (id: number) => {
    return await request.get({ url: `/data/teacher-study/get?id=` + id })
  },

  // 新增教师学习情况
  createTeacherStudy: async (data: TeacherStudyVO) => {
    return await request.post({ url: `/data/teacher-study/create`, data })
  },

  // 修改教师学习情况
  updateTeacherStudy: async (data: TeacherStudyVO) => {
    return await request.put({ url: `/data/teacher-study/update`, data })
  },

  // 删除教师学习情况
  deleteTeacherStudy: async (id: number) => {
    return await request.delete({ url: `/data/teacher-study/delete?id=` + id })
  },

  // 导出教师学习情况 Excel
  exportTeacherStudy: async (params) => {
    return await request.download({ url: `/data/teacher-study/export-excel`, params })
  },

  // ==================== 子表（教师学习交流） ====================

  // 获得教师学习交流分页
  getTeacherStudyExchangePage: async (params) => {
    return await request.get({ url: `/data/teacher-study/teacher-study-exchange/page`, params })
  },
  // 新增教师学习交流
  createTeacherStudyExchange: async (data) => {
    return await request.post({ url: `/data/teacher-study/teacher-study-exchange/create`, data })
  },

  // 修改教师学习交流
  updateTeacherStudyExchange: async (data) => {
    return await request.put({ url: `/data/teacher-study/teacher-study-exchange/update`, data })
  },

  // 修改教师学习交流
  updateTeacherStudyExchangeStatus: async (data) => {
    return await request.put({
      url: `/data/teacher-study/teacher-study-exchange/updateStatus`,
      data
    })
  },

  // 删除教师学习交流
  deleteTeacherStudyExchange: async (id: number) => {
    return await request.delete({
      url: `/data/teacher-study/teacher-study-exchange/delete?id=` + id
    })
  },

  // 获得教师学习交流
  getTeacherStudyExchange: async (id: number) => {
    return await request.get({ url: `/data/teacher-study/teacher-study-exchange/get?id=` + id })
  },

  // ==================== 子表（教师学习培训进修） ====================

  // 获得教师学习培训进修分页
  getTeacherStudyTrainPage: async (params) => {
    return await request.get({ url: `/data/teacher-study/teacher-study-train/page`, params })
  },
  // 新增教师学习培训进修
  createTeacherStudyTrain: async (data) => {
    return await request.post({ url: `/data/teacher-study/teacher-study-train/create`, data })
  },

  // 修改教师学习培训进修
  updateTeacherStudyTrain: async (data) => {
    return await request.put({ url: `/data/teacher-study/teacher-study-train/update`, data })
  },

  // 修改教师学习培训进修
  updateTeacherStudyTrainStatus: async (data) => {
    return await request.put({ url: `/data/teacher-study/teacher-study-train/updateStatus`, data })
  },

  // 删除教师学习培训进修
  deleteTeacherStudyTrain: async (id: number) => {
    return await request.delete({ url: `/data/teacher-study/teacher-study-train/delete?id=` + id })
  },

  // 获得教师学习培训进修
  getTeacherStudyTrain: async (id: number) => {
    return await request.get({ url: `/data/teacher-study/teacher-study-train/get?id=` + id })
  }
}
